﻿using System;
using System.Data;
using System.Globalization;
using System.Web.UI.WebControls;
using sdamarketing.App_Code;

namespace sdamarketing.Marketing
{
    public partial class payment : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CultureInfo ukCulture = new CultureInfo("en-GB");
        }
        protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
        {
            Title_lbl.Text = TitleList.SelectedValue;
            FirstName_lbl.Text = FirstName.Text;
            LastName_lbl.Text = LastName.Text;
            Email_lbl.Text = Email.Text;
            DoB_lbl.Text = BirthDay.SelectedValue + "/" + BirthMonth.SelectedValue + "/" + BirthYear.SelectedValue;

            Address1_lbl.Text = Address1.Text;
            Address2_lbl.Text = Address2.Text;
            City_lbl.Text = City.Text;
            State_lbl.Text = State.Text;
            Zip_lbl.Text = Zip.Text;
            Country_lbl.Text = Country.Text;
            PhoneNumber_lbl.Text = PhoneNumber.Text;
        }
        protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {         
            RemotePost myremotepost = new RemotePost();
            myremotepost.Url = "https://www.moneybookers.com/app/payment.pl";
            myremotepost.Add("pay_to_email", "boban.stojanovski@gmail.com");
            myremotepost.Add("return_url_text", "http://localhost/");
            myremotepost.Add("return_url_target", "1");
            myremotepost.Add("cancel_url_target", "1");
            myremotepost.Add("dynamic_descriptor", "Descriptor");
            myremotepost.Add("language", "EN");
            myremotepost.Add("confirmation_note", "Thank you for using our website.");
            myremotepost.Add("merchant_fields", "field1");
            myremotepost.Add("title", TitleList.SelectedValue);
            myremotepost.Add("firstname", FirstName.Text);
            myremotepost.Add("lastname", LastName.Text);
            myremotepost.Add("address", Address1.Text);
            myremotepost.Add("address2", Address2.Text);
            myremotepost.Add("phone_number", PhoneNumber.Text);
            myremotepost.Add("date_of_birth", BirthDay.Text + "" + BirthMonth.Text + "" + BirthYear.Text);
            myremotepost.Add("postal_code", Zip.Text);
            myremotepost.Add("city", City.Text);
            myremotepost.Add("state", State.Text);
            myremotepost.Add("country", Country.SelectedValue);
            myremotepost.Add("amount", Total.Text);
            myremotepost.Add("currency", "EUR");
            myremotepost.Add("amount2_description", "Цена за рекламата:");
            myremotepost.Add("amount2", Total.Text);
            //myremotepost.Add("amount3_description", "Room Price:"); //Ovde treba eden for za site selektirani sobi
            //myremotepost.Add("amount3", "3.10");
            myremotepost.Add("amount4_description", "VAT (20%):");
            myremotepost.Add("amount4", "0");
            

           // reklamiZaKorisnici reklami = new reklamiZaKorisnici();
           // DataSet ds = reklami.getPodatociZaReklama(Int32.Parse(Session["idUser"].ToString()));
           // string detail1_text = ds.Tables[0].Rows[0]["idReklama"].ToString();

            myremotepost.Add("detail1_description", "Product ID:");
            myremotepost.Add("detail1_text", "4509334"); // Ovde treba da se stavi id od tabelata booking
            myremotepost.Add("detail2_description", "Description:");
            myremotepost.Add("detail2_text", "Наплата за поставување реклама на веб сајтот.");
            myremotepost.Add("detail3_description", "Seller ID:");
            myremotepost.Add("detail3_text", "12345");
            myremotepost.Add("rec_period", "1");
            myremotepost.Add("rec_grace_period", "1");
            myremotepost.Add("rec_cycle", "day");
            myremotepost.Add("ondemand_max_currency", "EUR");
            myremotepost.Add("", "EPY");
            myremotepost.Add("payment_methods", "WLT,IDL,PWY,PWY5,PWY6,PWY7,PWY14,PWY15,PWY37,PWY17,PWY18,PWY19,PWY20,PWY21,PWY22,PWY26,PWY25,PWY28,PWY32,PWY33,PWY36,ACC,VSA,MSC,VSD,VSE,AMX,DIN,JCB,MAE,LSR,SLO,GCB,SFT,DID,GIR,ENT,EBT,SO2,NPY,PLI,DNK,CSI,PSP,EPY,");
            myremotepost.Add("submit_id", "Submit");
            myremotepost.Add("pay_from_email", Email.Text);

            myremotepost.Post();
        }
    }
}
